

var ii = 0;
mjs.require('_module_registration.js', [ ] ,

   function (component) {
    var Instance = function() {
        var dialog = null;
        
        var loaded = false;
        
        component.id = '1-0-1';
        
        var dialogDiv = document.createElement("DIV");
        dialogDiv.id = "f-" + (ii++);
        
        document.body.appendChild(dialogDiv);
        
        function renderDialog(data) {
          dialog = new YAHOO.widget.Panel(dialogDiv.id,
                                          { 
                                            visible : false, 
                                            draggable : true, 
                                            close : true,
                                            fixedcenter : true, 
                                            effect:[{ 
                                                    effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5}
                                                   ]} 
                                         );
              dialog.setHeader("Registration");
              dialog.setBody(data);
              dialog.render(document.body);
       }
    
    
       function registrationCallback(data) {
          renderDialog(data);
          loaded = true;
          dialog.show();
       }
    
       var show = function() {
           if (! loaded) {
                registrationController.getRegistrationView({ callback: registrationCallback });
                return;
           }
           dialog.show();
       }
       
       component.onclick = function() {
          show();
       }
   };
   new Instance();
   
   
   
}

);


//alert('registration inside call');